package com.xishu.controller;

import com.xishu.entity.oplog.OpLog;
import com.xishu.response.ResponseData;
import com.xishu.service.CommonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@Api(description = "操作日志")
@RestController
public class OpLogController {
    @ApiOperation(value = "操作日志查询")
    @PutMapping(value = ("/op/log"), produces = ("application/json;charset=UTF-8"))
    public ResponseData search(@RequestBody OpLog opLog) throws Exception {
        opLog.setSortField(new String[]{"createTime"});
        opLog.setSortType("DESC");
        return CommonService.getInstance().searchResponse(opLog);
    }

}
